<?php

namespace App\Repository;

/**
 * 基础数据仓储类
 *
 * @author WangBin
 */
class BaseRepo
{
    private static $repoInstance = [];

    /**
     * 获取自身单例类
     *
     * @return static
     */
    public static function getInstance() {
        if ((self::$repoInstance[static::class] ?? []) instanceof static) {
            return self::$repoInstance[static::class];
        }
        return self::$repoInstance[static::class] = new static;
    }
}